package 实验五;
import java.util.Scanner;

public class shiyan5_2 {
	public static void main(String argc[])
	{
		
		        Scanner scanner = new Scanner(System.in);
		        System.out.print("请输入数字的个数: ");
		        int n = scanner.nextInt();
		        int[] numbers = new int[n];
		        int sum = 0;
		        System.out.println("请输入数字: ");
		        for (int i = 0; i < n; i++) {
		            numbers[i] = scanner.nextInt();
		            sum += numbers[i];
		        }
		        System.out.println("排序后的结果为");
		        for(int i=0;i<n;i++)
		        	for(int j=i+1;j<n;j++)
		        	{
		        		if(numbers[i]>numbers[j])
		        		{
		        			sum=numbers[i];
		        			numbers[i]=numbers[j];
		        			numbers[j]=sum;
		        		}
		        	}
		        	for(int i=0;i<n;i++)
		        	{
		        		System.out.println(numbers[i]);
		        	}

		        
		    }
		
	}

